package com;

import com.srevice.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestHelloSpring {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        HelloSpring helloSpring = (HelloSpring) applicationContext.getBean("helloSpring");
        helloSpring.show();
        UserService userService = (UserService) applicationContext.getBean("userService");
        boolean flag = userService.login("张三","123456");
        if (flag){
            System.out.println("登录成功");
        }else{
            System.out.println("登录失败");
        }
    }
}
